/*
 * FocusEvent.java  0.4.0 / Oct 24, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
package com.cute4j.swing.events;

import com.cute4j.swing.Component;

/**
 * Focus Event.
 *
 * @author Slobodan Vrkacevic
 * @version 0.4.0
 */
public class FocusEvent extends ComponentEvent {

// Public Static Fields. -------------------------------------------------------

  /**
   * Focus gained id.
   */
  public static final int FOCUS_GAINED = 1004;

  /**
   * Focus lost id.
   */
  public static final int FOCUS_LOST = 1005;

// Private Static Fields. ------------------------------------------------------

  private static final long serialVersionUID = -7828789101288890555L;

// Public Constructors. --------------------------------------------------------

  /**
   * Constructs new FocusEvent object.
   *
   * @param source the source component of the event
   * @param id the event id
   *
   * @throws IllegalArgumentException if the source is <tt>null</tt>
   */
  public FocusEvent(Component source, int id) {
    super(source, id);
  }

// Overridden Methods. ---------------------------------------------------------

  /**
   * {@inheritDoc}
   */
  public String paramString() {
    switch(id) {
      case FOCUS_GAINED:
        return "FOCUS_GAINED";
      case FOCUS_LOST:
        return "FOCUS_LOST";
      default:
        return "unknown type";
    }
  }

}
